package com.liliang.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liliang.entity.Supplier;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liliang
 * @since 2021-11-04
 */
public interface SupplierMapper extends BaseMapper<Supplier> {

    @Select("select a.* from supplier a,supp_material b,material c where a.ID=b.SUPPLIER_ID and c.ID=b.MATERIAL_ID  and c.MATERIAL_NUM=#{a}")
    List<Supplier> findSupplierByMATERIAL_NUM(@Param("a") String materialCode);

    @Select("select a.* from supplier a,stock_supplier b,stock c where a.id=b.supplier_id and c.id=b.STOCK_ID and c.ID=#{a}")
    List<Supplier> findBYstockid(@Param("a")long id);
}
